package com.qingke.OMS.Command.Imp;

import java.util.List;

import com.qingke.OMS.Command.Command;
import com.qingke.OMS.Dao.PeopleDao;
import com.qingke.OMS.Pojo.People;
import com.qingke.OMS.Unit.Console;

public class checkPeopleByIdCommand implements Command{

	@Override
	public void execute() {
		PeopleDao pdao=new PeopleDao();
	    int id=Console.askUserInputInt("Please enter what you want to check of id?");	
		List<People> peoples=pdao.checkPeopleByUserId(id);
		  if(peoples.size() == 0){
		    	Console.println("Invalid quetion ID!");
		        return ;
		    }else{
		 for (People people2 : peoples) {
			System.out.println(people2);
		}
	}
	}
}
